<!doctype html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <title>添加城市</title>
	    <link rel="stylesheet" type="text/css" href="/webapp/css/easyui.css">
	    <link rel="stylesheet" type="text/css" href="/webapp/css/icon.css">
      <link rel="stylesheet" type="text/css" href="/webapp/css/color.css">
      <link rel="stylesheet" type="text/css" href="/webapp/css/public.css">
	    <script type="text/javascript" src="/webapp/js/lib/jquery.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/jquery.easyui.min.js"></script>
	    <script type="text/javascript" src="/webapp/js/lib/ajaxfileupload.js"></script>
	    <script type="text/javascript" src="/webapp/js/common/config.js"></script>
    </head>
    <body class="easyui-layout">
       <div class="easyui-container-fluid">
          <div class="easyui-panel">
            <div class="nav" id="nav"></div> 
            <div class="easyui-panel" >
              <form id="ff" method="post">
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">代码：</label>
                  <input class="easyui-textbox" name="code" >
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">市/县：</label>
                  <input class="easyui-textbox" name="name">
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">隶属城市：</label>
                  <select class="easyui-combobox" name="belongingCityCode" label="" style="width:174px">
                      <option value="value1">电视</option>
                      <option value="value2">冰箱</option>
                      <option value="value3">空调</option>
                      <option value="value4">洗衣机</option>
                    </select>
                </div>
                
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">省份：</label>
                  <select class="easyui-combobox" name="provinceCode" label="" style="width:174px">
                    <option value="value1">单选</option>
                    <option value="value2">多选</option>
                    <option value="value3">复杂</option>
                    <option value="value4">精简</option>
                  </select>
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">市场级别：</label>
                  <select class="easyui-combobox" name="marketLevelCode" label="" style="width:174px">
                    <option value="value1">一级市场</option>
                    <option value="value2">二级市场</option>
                    <option value="value3">三级市场</option>
                    <option value="value4">四级市场</option>
                  </select>
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">城市级别：</label>
                  <select class="easyui-combobox" name="cityScaleCode" label="" style="width:174px">
                    <option value="value1">一线城市</option>
                    <option value="value2">二线城市</option>
                    <option value="value3">三线城市</option>
                    <option value="value4">县域城市</option>
                  </select>
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">南北方：</label>
                  <select class="easyui-combobox" name="category" label="" style="width:174px">
                    <option value="value1">南方</option>
                    <option value="value2">北方</option>
                  </select>
                </div>
                <div style="margin-bottom:20px">
                  <label for="" class="item-label">城市区域：</label>
                  <select class="easyui-combobox" name="erea" label="" style="width:174px">
                    <option value="value1">华北地区</option>
                    <option value="value2">华南地区</option>
                    <option value="value3">华东地区</option>
                    <option value="value4">华中地区</option>
                    <option value="value4">东北地区</option>
                    <option value="value4">西北地区</option>
                    <option value="value4">西南地区</option>
                  </select>
                </div>
              </form>
              <div style="text-align:center;padding:5px 0">
                <a href="javascript:void(0)" class="easyui-linkbutton c8" onclick="submitForm()" style="width:80px">Submit</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">Clear</a>
              </div>
            </div>
          </div> 
       </div>  
    </body>
    <script type="text/javascript">
       var id=getQueryParameter("id");
       $(function(){
           setNav();
           if(id){
            $.ajax({
              url:config.url +"/city",
              type:'get',
              data:{id:id},
              xhrFields:{withCredentials:true},
              success:function(data){
                //填充表单
                  if(data){
                      $("#ff").form("load",changeProperty2String(data.content[0]));
                      $("#code").textbox("textbox").attr("readonly",true);
                  }   
              },
              error:function(){

              }
            });
          }
       });
    </script>
</html>
